In order to make a document available to the largest number of users, an author may create a document in a textual mark-up language such as Hypertext Markup Language (“HTML”). Textual mark-up languages can be displayed in Internet browsers such as the Microsoft Internet Explorer.
A textual mark-up language document contains both the document content (text, graphics, etc.) and the syntax that advises the browser how to display the document content. When a browser receives a textual mark-up language document, it displays the content within the browser view on the computer screen.
The syntax of a textual mark-up language includes mark-up tags that instruct the browser how to display elements of the content document within the browser view. For example, the author may request certain portions of the document to be underlined, italicized, or placed in a table. The actual way these requests are processed at the client browser varies depending on the browser implementation. The tags do not give direct control to the author, however the tags represent a standard that browsers generally attempt to honor.
A textual mark-up document author can obtain increased control over how content elements are displayed by using a style sheet. Cascading Style Sheets (CSS) is a specification circulated by the World Wide Web Consortium (W3C) that allows authors of HTML content documents to attach style sheets to HTML documents. A style sheet contains instructions defining how tag elements should appear. The style sheet may be embedded in the HTML document or linked to the HTML document.
Classically, HTML documents are based on a model of a ‘bottomless-page’ in which the content flows continuously without page-breaks. In the past, several methods have been employed to print HTML documents. For example, the prior version of Microsoft Internet Explorer generally employed opportunistic breaking.
Opportunistic breaking for printing involves simply measuring vertical space until one page has been completed and then sending that page off to the printer. The method takes a snap shot of where the last line ended, and starts the next page on the next line. Text is broken between lines, but elements with a hierarchical structure (like tables), may be clipped in the middle of the structure (e.g., in a cell), and started again on the next page from where it left off. There is no widow or orphan control that keeps two or three lines together by pushing them to the next page. The method continues to layout content until a vertical height equal to a page is reached. The method then breaks the layout, sends the first measured page to the printer, and starts laying out and measuring the next page.
The present invention allows the layout of an electronic source document to be defined through use of view templates. View templates in the illustrated embodiment allow a template author control over how content is rendered on the display and printed. View templates allow the use of pagination algorithms outside of the strict printing scenario and allow the template author greater control over content appearance on the display and on paged media. This embodiment allows a web host to create an attractive view template, and flow an arbitrary HTML content document into the rectangular areas defined by the view template. One embodiment of the invention illustrated herein allows only the web host to design and specify view templates. But this illustrated architecture easily allows a non-Web host entity to author the HTML view template.
For the purposes of illustration, the following discussion draws a distinction between content document authorship and view template authorship. A content document author is simply someone who creates a content document using a standard HTML markup language and available associated tools to define generally how it is displayed in any browser.
According to the illustrated embodiment of the invention, a new kind of HTML authorship is introduced—view template authorship. Now, a view template author designs an HTML view template document that takes the bottomless-page HTML content document and places it in a series of defined containers within the browser display, printer or other output device. The HTML content document is “flowed” into areas defined by the illustrated HTML view template document. The HTML view template document tells where to flow the HTML content document onto the display or printer. The HTML view template document identifies the HTML content document to be flowed and defines the series of rectangular areas that will hold the HTML content document.
Printing has been the flagship benefit since the illustrated embodiment provides a framework for pagination, but the significance of the invention is much broader. The illustrated embodiment supports output containing multiple stories flowing simultaneously across several pages, graphics interwoven with text, multiple columns, or almost whatever a template author can imagine. Further, once a view template design is complete, it can be reused as a template for other HTML content documents.
In the illustrated View Template, an object model (OM) is invoked by an HTML engine when a defined behavioral tag (“<LayoutRect>”) is encountered in the HTML view template script. In such an embodiment, the view template as supported by the OM represents an architecture that takes an arbitrary HTML content document that could have been displayed in a browser as written in the bottomless page model, and forces it into a series of containers that are defined in the view template by the view template author. This forced view of the content document allows changing the content document from the classic bottomless format into a page-based view.
One potential embodiment sizes the series of containers to a sheet of paper and generates a paginated view of the source document. Another embodiment sizes the series of containers to be half the width of a sheet of paper resulting in double column pagination. However, the containers can be sized and placed in almost any configuration offering an enormous level of creativity for HTML view template authorship.
Between these series of containers containing the content document, an embodiment could contain other HTML content elements defined directly within the View Template itself and/or multiple other series of containers containing other defined HTML content documents. In such an embodiment, content elements defined within the View Template itself could be flowed into the areas between the defined container areas.
Another embodiment could have multiple series of containers, each such series containing a different HTML content document source. In such an embodiment, these multiple series could be displayed side by side, intermittently, or in any defined series of rectangle areas and in any defined order. Finally, since the mark-up language is the same in the content document and the view template document, it is possible to nest layout rectangles within layout rectangles (e.g., use layout rectangles in the content document).
The series of containers in the illustrated embodiment of the View Template, and the structures that support them, are the heart of the View Template OM. In the illustrated embodiment, each container in the series has a layout that defines the size, location, and ordering for the content document to flow through while in that container. The order of containers that the content document flows through is kept in a view chain.
In this illustrated example, a view chain also maintains a break table with information about the content document at each of the container boundaries. When the content document fills one container and the next container designated in the view template is encountered for that content document, that next container accesses the break table to determine where to start to continue to flow the content document. In this embodiment, the container and the associated break information are tied to the element objects in the content document through a container layout context identifier, and it is this layout context identifier that defines the layout process for the content document. Each of these objects will be addressed in detail in the following sections.